<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
    <button id="print">打印当前页面</button>
	<p>这是window对象中的一个打印功能</p>
	<p>只需要调用window.print()方法就能够实现打印</p>
 </body>
   <script>
     window.onload = function(){
	   var print = document.getElementById("print");
	   print.onclick = function(){
	      window.print();
	   }
	 }
   </script>
</html>
